<?php
namespace app\api\service;


class PageService
{
    public $PageSize = 10;//默认10页

    public function __construct($data){
        //默认类型为1
        if(!isset($data['type']))
            $data['type'] = '1';
        $data['where']['type'] = $data['type'];
        $data['where']['is_hidden'] = '0';
        $page = '1';//初始第一页
        if(isset($get['page']))
            $page = $get['page'];
        $data['limit']['StartPage'] = ($page- 1) * $this->PageSize;//起始页
        $data['limit']['PageSize'] = $this->PageSize;//起始页
        return $data;
    }

}